import os
import shutil

# 定义目录结构
dirs = {
    'agent': ['agent_server.py', 'agent_client.py', 'test_agent.py'],
    'mcp': ['mcp_server.py', 'fast_mcp_server.py', 'mcp_demo.py', 'test_mcp.py', 'test_flow.py', 'test_all.py'],
    'scripts': ['run_agent.py', 'run_tests.py', 'auto_verify.py', 'setup.py', 'start_services.ps1',
                'start_services.bat', 'start_mcp.bat', 'start_mcp.sh', 'run.bat', 'test.bat'],
    'docs': ['README.md', 'mcp_explanation.md', 'mcp_knowledge_base.md'],
    'static': ['index.html']
}

# 创建子目录
for dir_name in dirs:
    os.makedirs(dir_name, exist_ok=True)

# 移动文件到对应目录
for dir_name, files in dirs.items():
    for file in files:
        if os.path.exists(file):
            shutil.move(file, os.path.join(dir_name, file))
            print(f"Moved {file} to {dir_name}/")

print("Project files organized successfully!")
